<?php
/**
 * Created by PhpStorm.
 * Author: 芸签cms www.yunqiancms.com
 * User: sun
 * Date: 2022/9/27
 * Time: 2:18 PM
 */
namespace app\frontend\modules\site\services;

use app\common\models\ThemeFile;
use app\common\services\theme\ThemeService;

class IndexService
{
    public function getData($themeInfo):array {
        $themeService = new ThemeService();
        $themeFileInfo = $themeInfo['themeFiles'][0];
        $pageData = $themeService->pageData($themeFileInfo);
        $datas = $pageData['datas'];
        $siteInfo  = (new SiteBaseService())->siteInfo();
        return [
            'site_info'=>$siteInfo,
            'vars' =>$datas
        ];
    }
}